<?php

/**
 * Merits form base class.
 *
 * @method Merits getObject() Returns the current form's model object
 *
 * @package    rpgcom
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseMeritsForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'idMerit' => new sfWidgetFormInputHidden(),
      'name'    => new sfWidgetFormInputText(),
      'effect'  => new sfWidgetFormTextarea(),
      'joc'     => new sfWidgetFormInputText(),
      'type'    => new sfWidgetFormInputText(),
      'cost'    => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'idMerit' => new sfValidatorPropelChoice(array('model' => 'Merits', 'column' => 'idMerit', 'required' => false)),
      'name'    => new sfValidatorString(array('max_length' => 55)),
      'effect'  => new sfValidatorString(),
      'joc'     => new sfValidatorInteger(array('min' => -128, 'max' => 127)),
      'type'    => new sfValidatorString(),
      'cost'    => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
    ));

    $this->widgetSchema->setNameFormat('merits[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Merits';
  }


}
